package au.com.bluelink.scjp.chap4;

public class BreakContinueTest {

	public static void main(String[] args) {

		boolean problem = true;
		while (true) {
			if (problem) {
				System.out.println("There was a problem");
				break;
				// System.out.println("shouldn't get here..."); will not
				// complile
			}
			System.out.println("shouldn't get here...");
		}
		System.out.println("...next line of code");

		outer:
		for (int i = 0; i < 5; i++) {
			inner:
			for (int j = 0; j < 5; j++) {
				System.out.println("Hello i = " + i + " j = " + j);
				continue outer;
			} // end of inner loop
			System.out.println("outer"); // Never prints
		}
		System.out.println("Good-Bye");

	}

}
